#!/bin/bash

set -x
install nvstat /usr/bin/nvstat
install nvstatd /usr/sbin/nvstatd
touch /var/run/nvstatd.pid
chmod 644 /var/run/nvstatd.pid
chown root:root /var/run/nvstatd.pid
cp nvstatd.service /lib/systemd/system/
systemctl daemon-reload
lspci |grep -i nvidia
if [ $? -eq 0 ]; then
    systemctl enable nvstatd.service
    systemctl restart nvstatd.service
    systemctl status nvstatd.service
fi
